<?php

defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

/**
 * View class 
 */
class TaxibookingViewCountys extends JView
{

    function display($tpl = null)
    {
        global $mainframe, $option;
//       var_dump(JRequest::get());
        //initialise variables
        $user = & JFactory::getUser();
        $db = & JFactory::getDBO();
        $document = & JFactory::getDocument();
        $lang = & JFactory::getLanguage();

        JHTML::_('behavior.tooltip');

        //get vars
//		$filter_order		= $mainframe->getUserStateFromRequest( $option.'.county.filter_order', 		'filter_order', 	'c.ordering', 'cmd' );
//		$filter_order_Dir	= $mainframe->getUserStateFromRequest( $option.'.county.filter_order_Dir',	'filter_order_Dir',	'', 'word' );
//		$filter_state 		= $mainframe->getUserStateFromRequest( $option.'.county.filter_state', 		'filter_state', 	'*', 'word' );
//		$search 			= $mainframe->getUserStateFromRequest( $option.'.county.search', 			'search', 			'', 'string' );
//		$search 			= $db->getEscaped( trim(JString::strtolower( $search ) ) );
        $filter_state = $this->get('State');
        $search = $this->get('Search');
        //add css and submenu to document
        $document->addStyleSheet('components/com_taxibooking/assets/css/bookingbackend.css');

        //Create Submenu
        JSubMenuHelper::addEntry(JText::_('HOME'), 'index.php?option=com_taxibooking');
        JSubMenuHelper::addEntry(JText::_('ITEMS'), 'index.php?option=com_taxibooking&view=orders');
        JSubMenuHelper::addEntry(JText::_('INTEREST_POINTS'), 'index.php?option=com_taxibooking&view=points');
        JSubMenuHelper::addEntry(JText::_( 'ROUTES' ), 'index.php?option=com_taxibooking&view=routes');
        JSubMenuHelper::addEntry(JText::_('COUNTYS'), 'index.php?option=com_taxibooking&view=countys', true);
        JSubMenuHelper::addEntry(JText::_('DISTRICTS'), 'index.php?option=com_taxibooking&view=districts');
        JSubMenuHelper::addEntry(JText::_('SETTINGS'), 'index.php?option=com_taxibooking&view=settings');

        //create the toolbar
        JToolBarHelper::title(JText::_('COUNTYS'), 'generic');
        JToolBarHelper::addNew();
        JToolBarHelper::spacer();
        JToolBarHelper::editList();
        JToolBarHelper::spacer();
        JToolBarHelper::deleteList();

        //Get data from the model
        $rows = & $this->get('Data');
//		$pageNav 	= & $this->get( 'Pagination' );
        $pageNav = $this->get('Pagination');
//        print_r($pagNav);
        $state[] = JHTML::_('select.option', '', '- ' . JText::_('Select State') . ' -');
        $state[] = JHTML::_('select.option', 'P', JText::_('PUBLISHED'));
        $state[] = JHTML::_('select.option', 'U', JText::_('UNPUBLISHED'));

        $lists['state'] = JHTML::_('select.genericlist', $state, 'filter_state', 'class="inputbox" size="1" onchange="submitform( );"', 'value', 'text', $filter_state);

        // search filter
        $lists['search'] = $search;

        // table ordering
        $lists['order_Dir'] = $filter_order_Dir;
        $lists['order'] = $filter_order;

        $ordering = ($lists['order'] == 'c.ordering');

        //assign data to template
        $this->assignRef('lists', $lists);
        $this->assignRef('rows', $rows);
        $this->assignRef('pageNav', $pageNav);
        $this->assignRef('ordering', $ordering);
        $this->assignRef('user', $user);
        $this->assignRef('direction', $lang);

        parent::display($tpl);
    }

}

?>